package com.cofi.vueelementadminserver.config.security;

import lombok.Getter;
import lombok.Setter;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.util.Collection;

/**
 * @author xyh
 * @date 2025-01-06
 * @description 用户信息
 */
@Getter
@Setter
public class SecurityUserDetail extends User {

    /**
     * 默认跳转路径
     */
    private String loginSuccessUrl = "/";

    /**
     * 主键
     */
    private String id;

    /**
     * 登录名称
     */
    private String logName;

    /**
     * 用户名，昵称
     */
    private String nickName;

    /**
     * 职务名称
     */
    private String userPostName;

    /**
     * 年级
     */
    private String gradleName;

    /**
     * 班级
     */
    private String className;

    /**
     * token键名称
     */
    private String tokenKey;



    public SecurityUserDetail(String username, String password, Collection<? extends GrantedAuthority> authorities) {
        super(username, password, authorities);
    }

    public SecurityUserDetail(String username, String password, boolean enabled, boolean accountNonExpired, boolean credentialsNonExpired, boolean accountNonLocked, Collection<? extends GrantedAuthority> authorities) {
        super(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities);
    }
}
